package com.shao.text;


import com.shao.Dao.impl.UserDaoImpl;
import com.shao.pojo.User;
import org.junit.Test;


/**
 * Created with IntelliJ IDEA.
 * User: SJP
 * Date: 2021/5/12
 * Time: 10:04
 * Description: No Description
 */
public class UserDaoTest {
    UserDaoImpl userDao = new UserDaoImpl();
    @Test
    public void queryUserByUsername() {
        if(userDao.queryUserByUsername("admin")==null){
            System.out.println("用户名可用");
        }else{
            System.out.println("用户名已存在");
        }
    }

    @Test
    public void queryUserByUsesnameAndPassword() {
        if(userDao.queryUserByUsesnameAndPassword("admin","admin")==null){
            System.out.println("用户名或者密码有误");
        }else{
            System.out.println("登录成功");
        }
    }

    @Test
    public void saveUser() {
        System.out.println(userDao.saveUser(new User(null,"wsas","123","123@qq.com")));
    }
}
